package org.itstack.demo.design;

/**
 * @Author: fanYuLe
 * @CreateTime: 2023-12-15  15:12
 * @Description: 懒汉模式（线程安全）
 */
public class Singleton_02 {

    private static Singleton_02 instance;

    private Singleton_02(){}

    private static synchronized Singleton_02 getInstance(){
        if(null!=instance){
            return instance;
        }
        return new Singleton_02();
    }

}
